package com.mycoupon.mycouponframework.exception;

import com.mycoupon.mycouponframework.errorcode.BaseErrorCode;
import com.mycoupon.mycouponframework.errorcode.IErrorCode;

/**
 * @projectName: MyCoupon
 * @package: com.mycoupon.mycouponframework.exception
 * @className: RemoteException
 * @author: thinkBook
 * @description: 远程调用异常，如订单支付失败，向上抛出远程服务调用异常
 * @date: 2025/4/4 22:27
 * @version: 1.0
 */
public class RemoteException extends AbstractException {
    public RemoteException(String message) {
        this(message, null, BaseErrorCode.REMOTE_ERROR);
    }

    public RemoteException(String message, IErrorCode errorCode) {
        this(message, null, errorCode);
    }

    public RemoteException(String message, Throwable throwable, IErrorCode errorCode) {
        super(message, throwable, errorCode);
    }

    @Override
    public String toString() {
        return "RemoteException{" +
                "errorCode='" + errorCode + '\'' +
                ", errorMessage='" + errorMessage + '\'' +
                '}';
    }
}
